<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="<s:url value="/css/style.css"/>" rel="stylesheet"
			type="text/css" />
		<link href="<s:url value="/css/jquery.css"/>" rel="stylesheet"
			type="text/css" />
		<script type="text/javascript" src="<s:url value="/js/jquery.js"/>"></script>
		<script type="text/javascript" src="<s:url value="/js/common.js"/>"></script>
		<script type="text/javascript" src="<s:url value="/js/jquery-ui.js"/>"></script>
		<script type='text/javascript'
			src="<s:url value="/js/tableSel2.js"/>"></script>
		<script type="text/javascript">
	function doSubmit() {
		// here is validate form .
		$('#listForm').submit();
	};
 	function goArrange() {
 	   var year= $('#year').attr('value');
 	   var week=$('#week').attr('value');
 	   var url="<%=basePath%>academic/ClassArrange/beforeArrange?year="+year+"&week="+week;
 	   var aa=window.open(url,"_blank","resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,fullscreen=yes");  
    };
    function goView(id) {
       $('#id').val(id);
       var t=$('#listForm');
       t.attr('action',t.attr('action').replace('list','view'));
       $('#listForm').submit();
    };
 	$( function() {
		$('#selDate').datepicker({dateFormat:'yy-mm-dd'});
	});
</script>
	</head>
	<body>
		<s:include value="/common/up.jsp"></s:include>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td class="box">
					<s:form action="ClassArrange/list" name="listForm" id="listForm"
						namespace="/academic">
						<input type="hidden" id="startIndex" name="startIndex" value="0" />
						<input type="hidden" id="id" name="id"  />
						<table width="100%" border="0" cellpadding="0" cellspacing="0"
							class="searchbg">
							<tr>
								<td>
									Date:
									<s:date name="selDate" format="yyyy-MM-dd" var="showTimefmt" />
									<s:textfield  value="%{#showTimefmt}"   name="selDate" id="selDate" />
									<img src="<s:url value="/img/right/btns.gif"/>" border="0"
										onclick="javascript:doSubmit();" align="absmiddle" />
									Year:
									<s:select id="year" list="{2008,2009,2010,2011}" name="year">
									</s:select>
									Week:
									<s:select id="week"
										list="{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52}"
										name="week">
									</s:select>
									<img src="<s:url value="/img/right/Arrange.gif"/>" border="0"
										onclick="javascript:goArrange();" align="absmiddle" />
								</td>
							</tr>
						</table>
						<table width="100%" border="0" cellpadding="0" cellspacing="1"
							class="box2 activeTable">
							<tr>
								<td class="tablecolour1">
									ID
								</td>
								<td class="tablecolour1">
									Date
								</td>
								<td class="tablecolour1">
									Time
								</td>
								<td class="tablecolour1">
									ClassType
								</td>
								<td class="tablecolour1">
									ClassFocus
								</td>
								<td class="tablecolour1">
									Teacher
								</td>
								<td class="tablecolour1">
									Classroom
								</td>
								<td class="tablecolour1">
									Function
								</td>
							</tr>
							<s:iterator value="listResult.items" status="status">
								<tr>
									<td class="tablecolour2">
										<s:property value="#status.index+1" />
									</td>
									<td class="tablecolour2">
										<s:date name="classDate" format="yyyy-MM-dd E" />
									</td>
									<td class="tablecolour2">
										<s:property value="classTime" />
									</td>
									<td class="tablecolour2">
										<s:property value="classType.name" />
									</td>
									<td class="tablecolour2">
										<s:property value="classFocus.name" />
									</td>
									<td class="tablecolour2">
										<s:property value="teacher.name" />
									</td>
									<td class="tablecolour2">
										<s:property value="classroom.name" />
									</td>
									<td class="tablecolour2">
										<a onclick="javascript:goView('<s:property value="id"/>')"
											href="#">View</a>
									</td>
								</tr>
							</s:iterator>
						</table>
						<s:include value="/common/page.jsp"></s:include>
					</s:form>
				</td>
			</tr>
		</table>
		<s:include value="/common/down.jsp"></s:include>
	</body>
</html>
